package com.mycloud.controller;

import com.mycloud.dto.OrderDTO;
import com.mycloud.message.StreamClient;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.messaging.support.MessageBuilder;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import java.time.LocalDateTime;

/**
 * Created by PC on 2019/1/13.
 */
@RestController
public class SendMessageController {

    @Autowired
    private StreamClient streamClient;

/*    @GetMapping("/sendMsg")
    public void proess() {

        String msg = "now="+ LocalDateTime.now().toString();
        streamClient.output().send(MessageBuilder.withPayload("now "+ LocalDateTime.now()).build());
    }*/
   /* @GetMapping("/sendOrderMsg")
    public void sendOrderMsg() {

        OrderDTO orderDTO = new OrderDTO();
        orderDTO.setOrderId("qwertyuiop");
        streamClient.output().send(MessageBuilder.withPayload(orderDTO).build());
    }*/
}
